package org.example.aop.controller;


import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Slf4j
@RequestMapping("text")
@RestController
public class TextAspectDemo {
    @RequestMapping("t1")
    public String t1(){
        log.info("方法t1被执行");
        return "t1";
    }


    //存在异常
    @RequestMapping("t2")
    public String t2(){
        log.info("方法t2被执行");
        int n = 10/0;
        return "t2";
    }
}
